package day04;
import java.util.Scanner;
public class Test1 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入您的数：");
        int num= scan.nextInt();

        for(int i=1;i<=num;i++){
            int sum=0;
            for(int j=1;j<=i/2;j++){
                if (i%j==0){
                    sum+=j;
                }
            }
            if(sum == i){
                System.out.println("完美数："+i);
            }
        }

    }
}
